/*
Copyright (c) 2019 Alibaba Group Holding Limited

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

*/
//*******************************
//             PMU
//*******************************
#include "pmu.h"

#define PMU_BASE 0x60030000

#define PMU_EN_REG  0X00
#define PMU_PC_REG  0X04
#define PMU_LEN_REG  0X08
#define PMU_IFU_EN_REG 0X0C
#define PMU_IRAM_ADDR_REG 0X10

/**
  * @brief  weakup ree core
  * @param  pc_addr:set pc reset value
  * @retval None
  */

void Weak_Up_Ree_Core(uint32_t pc_addr)
{
    PMU->SPR |= pc_addr;
    PMU->WRC |= 0x00000002;
}
/**
  * @brief  set parameter about iram in bus matrix
  * @param  pmu_initstruct: set the ree iram bus matrix parameter
  * @retval None
  */

void Init_Iram_Bus_Param(PMU_InitTypeDef* pmu_initstruct)
{
    PMU->SIA |= pmu_initstruct->pmu_set_iram_addr;
    PMU->SIL |= pmu_initstruct->pmu_set_iram_len;
    PMU->IDE |= pmu_initstruct->pmu_iram_dec_en;
}

